package com.tuanzi.loan.business.entity.system;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Range;

import com.tuanzi.loan.core.entity.BaseEntity;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author Ray 2017/09/21
 */
@Data
@Entity
@Table(name = "TB_LOAN_DICTIONARY")
@EqualsAndHashCode(callSuper = true)
public class Dictionary extends BaseEntity {

	private static final long serialVersionUID = 7502344866101762234L;

	@Id
	@Column(name = "ID")
	@GeneratedValue(generator = "uuid2")
	@GenericGenerator(name = "uuid2", strategy = "org.hibernate.id.UUIDGenerator")
	private String id;

	@NotBlank
	@Length(max = 200)
	@Column(name = "CODE")
	private String code;

	@NotBlank
	@Length(max = 200)
	@Column(name = "DESCRIPTION")
	private String description;

	@NotBlank
	@Length(max = 200)
	@Column(name = "NAME")
	private String name;

	@NotBlank
	@Length(max = 200)
	@Column(name = "VALUE1")
	private String value1;

	@Length(max = 200)
	@Column(name = "VALUE2")
	private String value2;

	@Length(max = 200)
	@Column(name = "VALUE3")
	private String value3;

	@Length(max = 200)
	@Column(name = "VALUE4")
	private String value4;

	@NotNull
	@Column(name = "SORT")
	@Range(min = 0, max = Integer.MAX_VALUE)
	private Integer sort;

}
